<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@page import="weaver.general.Util"%>
<%
String id = Util.null2String(request.getParameter("id"));
%>
<html>
<head>
<title>我的答案</title>
</head>
<body>
<div id="vote_answer_my" class="page out">
	<style type="text/css">
		#vote_answer_my .content{top:0px;}
		#vote_answer_my .vote-btn{
			line-height: 35px;
		    border-radius: 5px;
		    color: #fff;
		    background: #017afd;
		    text-align: center;
	    }
		#vote_answer_my .footer {
		    padding: 10px;
		    height: 55px;
		    box-sizing: border-box;
		    border-top: 1px solid #e7e7e7;
		    display: none;
		}
		#vote_answer_my .content.permission{
			bottom:55px;
		}
		#vote_answer_my .footer.permission{
			display: block;
		}
	</style>
	<div class="content">
		<div class="survey_preview_content">   
          <form id="surveyform">
            <input type="hidden" name="votingid" value="<%=id %>" />
            <div class="survey_body">
              <div class="survey_title"></div>
              <div class="survey_content">
                <div class="survey_question clone" style="display: none;">
                  <div class="survey_quesname">
                    <span class="survey_quesnamedes"></span>
                    <span class="require" style="display: inline; color: red;">*</span>
                    <label class="rules"></label>
                  </div>
                  <div class="survey_options"></div>
                </div>
              </div>
            </div>
          </form>
        </div>
	</div>
	<div class="footer">
		<div class="vote-btn">查看调查结果</div>
	</div>
	<script type="text/javascript">
	$.extend(Vote, {
		buildMyAnswerPage : function(id){
			var that = this;
			var $page = $("#vote_answer_my");
			
			var url = "/mobilemode/apps/e-cology/vote/voteAction.jsp";
			that.ajax(url, {"operate": "getVotingById", "votingid": id}, function(data){
				survey.initSurvey(data.voteinfo.votepages, data.voteinfo.subject, "vote_answer_my");
				that.ajax(url, {"operate": "getMyVotingData", "votingid": id}, function(data){
					survey.fillUserInput(data.myVotingData);
					that.ajax(url, {"operate": "checkViewResultPermission", "votingid": id}, function(data){
						if(data.flag) {
							$(".content, .footer", $page).addClass("permission");
						}
					});
				});
			});
			
			$(".vote-btn", $page).click(function() {
				Mobilebone.ajax({
					url: "/mobilemode/apps/e-cology/vote/report.jsp?id="+id
				});
			});
		}
	});
	Vote.buildMyAnswerPage("<%=id%>");
	</script>
</div>
</body>
</html>
